
	<head>
		<meta charset="utf-8">
		<meta http-equiv="X-UA-Compatible" content="IE=edge" />
		<link href="../css/main.css" type="text/css" rel="stylesheet" />
		<link href="../css/dialog.css" rel="stylesheet" type="text/css">
		<title></title>
		<style type="text/css">
		
			
		.parameter{ position:absolute; background: #FAFAFA;z-index: 999999;left: calc(50% - 400px); top:0;width: 800px;}
		</style>

				
			<!-- 	<div class="turn_page" style="display:none">
				   <div class="main_page" id="pageCon">
					   <a href="javascript:void(0)" class="first_a" id="firstPage"></a>
					   <a href="javascript:void(0)" class="up_a" id="prev"></a>    	
					   <a href="javascript:void(0)" class="next_a" id="next"></a>
					   <a href="javascript:void(0)" class="last_a" id="lastPage"></a>
					   <input id="page_num_input" style="width:40px;" type="text" onblur="checkValue(this);" onkeyup="value=value.replace(/\D/g,'')"/>
					   <button type="button" class="num_input" id="go_num_input">跳转</button>
					   <b class="page_text">当前<i><em id="nowpage"></em>/<em id="totalpage"></em></i>页，总数<i id="totalNum"></i>条</b>    	
				   </div>
				</div> -->
				
				
				
				
					
				<!-- 	参数设置 -->		
				<div class=" parameter" >
					<div class="prop_top">
						<i>设备列表</i>
						<a href="javascript:void(0)" class="close_icon"><img src="../images/close_icon.png"></a>
					</div>
					<div class="bookdetail_box">
						<div class="blank_div"></div>
						<div class="blank_div"></div>
						<div class="label_div">
							<label class="text_label">设备名称：</label>
							<input type="text" class="input_search" placeholder="" id="qry_device_name" />
						</div>
						<div class="label_div">
							<label class="text_label">设备名称：</label>
							<input type="text" class="input_search" placeholder="" id="qry_device_name" />
						</div>
						&nbsp;&nbsp;&nbsp;&nbsp;
						<button class="btn_common2"  onclick="itemFormSubmit()">添加</button>
					    <div class="blank_div"></div>
					    <table  class="table_list">
						    <tr>
							<!-- <th width="6%">序号</th> -->
								<th width="30%">参数中文名</th>
								
								<th width="25%">参数名</th>
								<th width="30%">对应接口参数</th>
								<th class="last_td">操作</th>
							</tr>
							<tbody >
							
							<tr>
								<td>参数1</td>
								<td>paramter</td>
								<td>paramter</td>
								<td></td>
							</tr>
							</tbody>
					    </table>
					    
						<div class="blank_div"></div>
					    <div class="blank_div"></div><div class="blank_div"></div>
					    <div class="blank_div"></div>
									
					</div>
				</div>
				
				
	
		<script type="text/javascript" src="../js/jquery-1.10.2.min.js"></script>
		<script type="text/javascript" src="../js/common.js"></script>
		<script type="text/javascript" src="../js/dialog.js"></script>
		<script type="text/javascript" src="../js/jquery-data.js"></script>

		<script type="text/javascript">
			var yema=1;
			var pagelen=10;
			var totalPage=0;   
			function qryList(){		
				qryItemList();
			}
			
			$(document).ready(function(){
				//getModelCodeList();
				qryList();
			});
			function qryList(){
				qryItemList();
			}
			function qryItemListBtn(){
				 yema=1;
				qryItemList();
			}
			function qryItemList(){
				$.ajax({
					url: 'qryModelList', 
					type: 'POST',
					data:{//name:$("#qry_itemId").val(),
						name:$("#qry_brand").val(),
						yema:yema,length:pagelen},
					async: false,
					dataType: 'json', 
					timeout: 10000, 
					error: function(){LQWarn('请求失败,请稍后重试');}, 
					success: function(result){
						
						if(result.resultCode==1000){
							var items=result.returnObject.pageList;
							if (items && items.length > 0) {
								var rlist="";
								var item ;
								
								$.each(items,function(i){
									item = items[i];
									rlist+='<tr data-status ="'+ item.id+'"><td>'
										+ (i+1+length*(result.returnObject.curPage-1))
										+ '</td><td>' 
										+ item.name
										+'</td><td>'
										+ formatToDateTime(item.createTime)
										+'</td><td class="last_td">'
										+ '<a class="mod" title="参数设置" href="javascript:void(0);" onclick="toParameterForm(this)">参数设置</a>'
										+ '<a class="mod" title="修改" href="javascript:void(0);" onclick="toEditForm(this)">修改</a>'
										+ '<a class="del" title="删除" href="javascript:void(0);" onclick="delItem(this)">删除</a>'
										
										+ '</td></tr>';
								});
								$("#listbox1").html(rlist);
								totalPage=result.returnObject.totalPage;
								$("#nowpage").html(result.returnObject.curPage);
								$("#totalpage").html(totalPage);
								$("#totalNum").html(result.returnObject.totalNum);
								$(".turn_page").show();
							}else{
								$("#listbox1").html("");
								$(".turn_page").hide();
							}
						}
						else if(result.resultCode==1004){
							LQWarn(result.returnObject);
							window.top.location.href ="../login.jsp";
						}else{
							LQWarn(result.returnObject);
						}
					}
				});
			}
			
			var url_ = "addModel.do";
			
			function toAddForm(){
				$(".opacity_div,.bookDetail").not(".parameter").show();	
				url_ = "addModel.do";
				$("#form").clearForm();
			}

			
			function itemFormSubmit(){
			//	console.log($("#form").serialize());
					if($("#form").checkhaveNull()){
					return;
				}
				operateObject(url_,$("#form").serialize(),function(){edit_cancel();});
				//return;
				
			}
			
			
			function toEditForm(obj){
				var id = $(obj).parents("tr").attr("data-status");
				toAddForm();
				url_ = "editModel.do";
				getObjectWithFillData("getModelInfo.do",{"id":id},$("#form"));	
			}
			
			function delItem(obj){
				var id = $(obj).parents("tr").attr("data-status");
				delObject('delModel.do',{"id":id});	
				
			}
			
			function edit_cancel(){
				$(".opacity_div,.bookDetail").hide();
			}
			
			function toParameterForm(){
				$(".parameter,.opacity_div").show();	
				
			}
			
			

			
			
				
		</script>

